<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
    <!DOCTYPE html>
<html lang="en" class="app">
	<head>
		<meta charset="utf-8" />
		<link rel="stylesheet" href="<c:url value='/css/app.v2.css'></c:url>" type="text/css" />
</head>
<body>
						<section class="vbox">
							<section class="scrollable padder">
								<ul class="breadcrumb no-border no-radius b-b b-light pull-in">
									<li>
										<a href="index.html"><i class="fa fa-home"></i> 主页</a>
									</li>
									<li class="active">论坛管理</li>
									<li class="active">话题信息管理</li>
								</ul>
								<div class="m-b-md">
									<h3 class="m-b-none">话题列表</h3>
									<button type="button" class="btn btn-info pull-right " data-toggle="modal" data-target="#add">新增</button>
								</div>

								<!--表单一 -->
								
								<section class="panel panel-default">
									<header class="panel-heading"> 话题列表</header>
									<div class="table-responsive">
										<table id="MyStretchGrid" class="table table-striped datagrid m-b-sm">
											<thead>
												<tr>
													<th>序号</th>
													<th>ID</th>
													<th>话题名称</th>
													<th>描述</th>
													<th>主题数</th>
													<th>文章数</th>
													<th>编辑</th>
													<th>删除</th>
												</tr>
											</thead>
											<tbody class="formtable">
											<c:forEach items="${forumList}" var="forum" varStatus="status">
												<tr>
													<td>${status.index +1 }</td>
													<td>${forum.id }</td>
													<td><a href="<c:url value='/topic/getTopicList?pageId=1&forumid=${forum.id }'></c:url>">${forum.name }</a></td>
													<td>${forum.description }</td>
													<td>${forum.topiccount }</td>
													<td>${forum.articlecount }</td>
													<td>
														<a  class="edit" data-toggle="modal" type="button" data-target="#edit" onclick="returnForum(${forum.id});" >
															<i class="fa fa-pencil"></i>
														</a>
													</td>
													<td>
														<a type="button" onclick="sureDelete(${forum.id});">
															<i class="fa fa-trash-o"></i>
														</a>
													</td>
												</tr>
											</c:forEach>
											</tbody>
										</table>
										<nav class="pull-right">
										  <ul class="pagination ">
										    <li><a href="<c:url value='/forum/getForumList?pageId=1'></c:url>">首页</a></li>
										    <c:if test="${forumVO.currentPage > 1}">
										    	<li><a href="<c:url value='/forum/getForumList?pageId=${forumVO.currentPage -1}'></c:url>">上一页</a></li>
										    </c:if>
											<li><a href='<c:url value='/forum/getForumList?pageId=${forumVO.currentPage}'></c:url>'>${forumVO.currentPage }</a></li>
										    <c:if test="${forumVO.currentPage < forumVO.totalPage}">
										    	<li><a href="<c:url value='/forum/getForumList?pageId=${forumVO.currentPage +1}'></c:url>">下一页</a></li>
										    </c:if>
										    <li><a href="<c:url value='/forum/getForumList?pageId=${forumVO.totalPage}'></c:url>">尾页</a></li>
										     
										    <li>总页数：${forumVO.totalPage}</li>
										    <li>总记录数：${forumVO.totalCount}</li>
										  </ul>
										</nav>
									</div>
								</section>

							</section>
						</section>
						<a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a>
					</section>
					<aside class="bg-light lter b-l aside-md hide" id="notes">
						<div class="wrapper">Notification</div>
					</aside>
				</section>
			</section>

		<!--
        	作者：offline
        	时间：2016-12-26
        	描述：摸态框 add
        -->
		<!-- Modal -->
		<div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title" id="myModalLabel">添加话题</h4>
					</div>
					<div class="modal-body">
						<form role="form" >
							<div class="form-group">
								<label for="username">话题名称</label>
								<input type="text" class="form-control" id="name" placeholder="话题名称">
							</div>
							<div class="form-group">
								<label for="password">描述</label>
								<input type="text" class="form-control" id="description" placeholder="简短的描述" >
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<button id="btn" type="button" class="btn btn-primary" >提交</button>
					</div>
				</div>
			</div>
		</div>
		
		<!-- Modal -->
		<div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title" id="myModalLabel">修改话题</h4>
					</div>
					<div class="modal-body">
						<form role="form" >
						<input type="hidden" id="forumid">
							<div class="form-group">
								<label for="username">话题名称</label>
								<input type="text" class="form-control" id="ename" placeholder="话题名称">
							</div>
							<div class="form-group">
								<label for="password">描述</label>
								<input type="text" class="form-control" id="edescription" placeholder="简短的描述" >
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<button id="updateBtn" type="button" class="btn btn-primary" >更新</button>
					</div>
				</div>
			</div>
		</div>
		
		
		
		<script src="<c:url value='/js/jquery-3.1.0.min.js'></c:url>"></script>
		<script src="<c:url value='/js/app.v2.js'></c:url>"></script>
		<script src="<c:url value='/js/layer.js'></c:url>"></script>
		<script src="<c:url value='/js/forum.js'></c:url>"></script>
</body>
</html>